<template>
<h1>双向绑定</h1>
  <hr>
  <input type="text" v-model="user.name">
  <input type="password" v-model="user.password">
  <br>
  性别：
  <input type="radio" name="gender" value="1" v-model="user.gender">男
  <input type="radio" name="gender" value="0" v-model="user.gender">女
  <br>
  <button @click="reg">注册</button>
  <button v-on:click="reg">注册</button>
  <hr>
  <input type="text" v-model="info">
  {{info}}

</template>
<script setup>
import {ref} from "vue";
const info=ref('')

const user=ref({
      name:'',
      password:'',
      gender:''

    });
const reg=()=>{
  console.log(user.value);
}


</script>


<style scoped>

</style>